Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ipns protobuf namespace conflict #794

Merged
merged 3 commits into from
Jan 21, 2025
Merged

fix: ipns protobuf namespace conflict #794

merged 3 commits into from
Jan 21, 2025

Conversation

guillaumemichel
Copy link
Contributor

Context

To solve protobuf namespace conflicts, #789 renamed record.proto to ipns-record.proto breaking protobuf dependency import since the filename has now changed. I think there is a better way to solve #788.

Proposed solution

While the go_package option set in the .proto file isn't included in the registered protobuf name, we can use a custom Makefile to register the full package name. This seems like a cleaner approach, since it registers the protobuf with the full package path, instead of just ipns-record.proto, and it doesn't break existing record.proto imports.

Protobuf package source before and after.

Also see libp2p/go-libp2p-record#62

Would that work for you @dereknola?

@guillaumemichel guillaumemichel requested a review from a team as a code owner January 17, 2025 12:55
Copy link

welcome bot commented Jan 17, 2025

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 72.22222% with 30 lines in your changes missing coverage. Please review.

Project coverage is 60.52%. Comparing base (de52bc8) to head (fbe6ba1).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
ipns/pb/record.pb.go 72.22% 29 Missing and 1 partial ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #794   +/-   ##
=======================================
  Coverage   60.52%   60.52%           
=======================================
  Files         245      245           
  Lines       31130    31130           
=======================================
+ Hits        18841    18842    +1     
+ Misses      10613    10611    -2     
- Partials     1676     1677    +1     
Files with missing lines Coverage Δ
ipns/record.go 68.21% <ø> (ø)
ipns/pb/record.pb.go 72.22% <72.22%> (ø)

... and 11 files with indirect coverage changes

Copy link
Contributor

@dereknola dereknola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for K3s, I'm not seeing any conflicts when I inject your PR commit.

Copy link
Contributor

@gammazero gammazero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to avoid makefile. See comments.

ipns/pb/Makefile Outdated Show resolved Hide resolved
ipns/pb/Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@gammazero gammazero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets merge this before the next boxo version and kubo RC2. We can decide between Makefile and go:generate in a later PR.

@gammazero gammazero force-pushed the fix/ipns-protobuf branch 2 times, most recently from d443b97 to b91a277 Compare January 20, 2025 22:05
@gammazero
Copy link
Contributor

Using go:generate also means it can be run from a top-level directory, go generate ./..., without having to know where a makefile is located

@gammazero gammazero merged commit 3586985 into main Jan 21, 2025
15 checks passed
@gammazero gammazero deleted the fix/ipns-protobuf branch January 21, 2025 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants